package com.pansoft.openplanet.util;

import android.content.Context;

import com.pansoft.openplanet.constant.TalkChainConstant;

import java.io.File;

/**
 * Created by will on 18-3-24.
 */

public class FileUtil {

    /**
     * 判断主钱包文件夹中是否有文件
     *
     * @param number  登录帐号 手机号
     * @param context
     * @return
     */
    public static boolean isHaveWallet(String number, Context context) {
        try {
            File keystoreFileDir = new File(TalkChainConstant.getDataFilePath(context) + File.separator + number);
            if (keystoreFileDir.exists()) {
                if (keystoreFileDir.isDirectory()) {
                    if (keystoreFileDir.listFiles().length > 0) {
                        return true;
                    }
                }
            }
            return false;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

    }
}
